﻿using NLog;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ApisixSDK.Common.Profile
{
	public class DefaultProfile : Profile
	{
		private string endpoint;
		private Credential credential;
		private Logger logger;
		private string version;
		private HttpProfile httpProfile;

		private DefaultProfile(string endpoint, string version, Credential credential)
		{
			this.credential = credential;
			this.endpoint = endpoint;
			this.version = version;
			this.httpProfile = new HttpProfile();
		}

		public static DefaultProfile getProfile(string endpoint, string version, Credential credential)
		{
			lock (typeof(DefaultProfile))
			{
				DefaultProfile profile = new DefaultProfile(endpoint, version, credential);
				return profile;
			}
		}

		public virtual Credential Credential
		{
			get
			{
				lock (this)
				{
					return this.credential;
				}
			}
		}

		public virtual Logger Logger
		{
			get
			{
				return this.logger;
			}
			set
			{
				this.logger = value;
			}
		}


		public virtual string Version
		{
			get
			{
				return this.version;
			}
		}

		public virtual string Endpoint
		{
			get
			{
				return this.endpoint;
			}
		}

		public virtual HttpProfile HttpProfile
		{
			get
			{
				return this.httpProfile;
			}
		}

	}
}
